package com.imti.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class VerifyPhone {

    public static String verifyPh(String ph) {
        String verifyPh = "^1\\d{10}$";

        // 创建 Pattern 对象
        Pattern pattern = Pattern.compile(verifyPh);

        // 创建 Matcher 对象
        Matcher matcher = pattern.matcher(ph);
        if (matcher.matches()) {
            System.out.println("手机号码格式正确");
        } else {
            System.out.println("手机号码格式不正确");
        }
        return verifyPh;
    }
}
